#if ENABLE_DOTNET_JSON
using GameFramework;
using System;
using GFUtility = GameFramework.Utility;
using Newtonsoft.Json;

namespace LS.Base
{
    public class LSJsonHelper : GFUtility.Json.IJsonHelper
    {
        public string ToJson(object obj)
        {
            return JsonConvert.SerializeObject(obj);
        }

        public T ToObject<T>(string json)
        {
            return JsonConvert.DeserializeObject<T>(json);
        }

        public object ToObject(Type objectType, string json)
        {
            return JsonConvert.DeserializeObject(json,objectType);
        }
    }
}
#endif